#include "information.h"
#include "ui_information.h"
#include "Image.h"
extern Image photo;

Information::Information(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Information)
{
    ui->setupUi(this);
    setWindowFlags(Qt::Tool| Qt::WindowStaysOnTopHint);
    ui->label_4->setText(QString::number(photo.Width())+"像素");
    ui->label_5->setText(QString::number(photo.Height())+"像素");
    int size=photo.Width()*photo.Height()*3;
    if(size<1024)
        ui->label_6->setText(QString::number(size)+"Byte");
    else if(size<1024*1024)
        ui->label_6->setText(QString::number((float)size/1024,'f',2)+"KB");
    else
        ui->label_6->setText(QString::number((float)size/1024/1024,'f',2)+"MB");
}

Information::~Information()
{
    delete ui;
}

void Information::on_pushButton_clicked()
{
    this->close();
}
